package com.pr.levin.prec;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Toast;

import com.pr.levin.dataideal.WebService;

import java.io.IOException;
import java.net.URL;
import java.sql.Connection;
import java.net.HttpURLConnection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * 测试专用Activity
 * Created by levin on 2018/10/30.
 */

public class JustTest extends AppCompatActivity {
    private static Handler handler = new Handler();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_reg_layout);

        new Thread(new MyThread()).start();
    }

    public class MyThread implements Runnable {  //-----------*2
        @Override
        public void run() {
            final String info = WebService.executeHttpGet("admin", "123");
            // info = WebServicePost.executeHttpPost(username.getText().toString(), password.getText().toString());
            handler.post(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(JustTest.this, info, Toast.LENGTH_LONG).show();

//                    dialog.dismiss();
                }
            });
        }
    }
}
